package day03;

public class IfElseDemo {
    public static void main(String[] args) {
        //分支结构：if...else结构
        //1.满500打八折，不满打九折
        double price1=600;
        if(price1>500){
            price1 *=0.8;
        }else {
            price1*=0.9;
        }
        System.out.println("最终结算金额为"+price1);
        double price2=480;
        if (price2>500){
            price2 *=0.8;
        }else{
            price2 *=0.9;
        }
        System.out.println("最终结算金额为"+price2);

        //2.判断成绩是否合法
        double score1 = -5;
        if (score1>=0 && score1<=100){
            System.out.println(score1+"为合法成绩");
        }else {
            System.out.println(score1+"为不合法成绩");
        }
        double score2 =99;
        if(score2 >=0 && score2<=100){
            System.out.println(score2+"为合法成绩");
        }else {
            System.out.println(score2+"为不合法成绩");
        }
        double score3=500;
        if(score3>=0 && score3<=100){
            System.out.println(score3+"为合法成绩");
        }else {
            System.out.println(score3+"为不合法成绩");
        }

    }
}
